home *** CD-ROM | disk | FTP | other *** search
- Path: grimsel.zurich.ibm.com!usenet
- From: Keith Whittingham <wgk@zurich.ibm.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Help! Macro replacement......
- Date: Fri, 12 Apr 1996 10:27:26 -0700
- Organization: IBM Zurich Research Laboratory
- Message-ID: <316E927E.4D4C@zurich.ibm.com>
- References: <4kega2$1tk@hptemp1.cc.umr.edu>
- NNTP-Posting-Host: pine.zurich.ibm.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.01 (Win16; I)
-
- re:
-
- #define ABS(X) ((X <= 0) ? -X : X)
-
- int y = ABS(-6+4);
-
- y = - - 6 + 4;
- or: y = --6 + 4;
-
-
- I'm not sure that it is explicitly defined (although I may well
- be wrong - I haven't looked very hard.
-
- What I would assume is that the pre-processor is assumed to output
- to the compiler and so two minus-signs adjacent to each other
- should decrement and the code should produce an error.
-
- In summary I'd be happy with the compiler that produces an error
- cause thats a difficult bug to find...
-
- --
- Keith Whittingham
- wgk@zurich.ibm.com
-